package com.itheima.edu.info.manager.day5;

import java.time.LocalDateTime;
import java.util.Random;

public class MaoPao {
    public static void main(String[] args) {
        Random r = new Random();
        int[] arr = new int[5000];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = r.nextInt(5000);
        }
      long d=  System.currentTimeMillis();
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length-1-i; j++) {
                if (i < arr.length) {
                    if ( arr[j]>arr[j+1]) {
                        int a = arr[j];
                        arr[j] = arr[j + 1];
                        arr[j + 1] = a;
                    }
                }
            }
        }
        long b=System.currentTimeMillis();
        long c=b-d;
        System.out.println(c+"----");
       // System.out.println(b+"-----");
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        LocalDateTime of = LocalDateTime.of(2020, 12, 10, 11, 35, 59);
        System.out.println(of);
        System.out.println(of.toLocalDate());
    }
}
